import pymysql


# 连接mysql的工具类
class MySqlTool:
    connection = None

    @staticmethod
    def s_connection_db():
        if MySqlTool.connection is None:
            # 建立数据库连接
            MySqlTool.connection = pymysql.connect(
                host='localhost',
                port=3306,
                user='admin',
                password='admin@123',
                database='group_insurance'
            )

        return MySqlTool.connection
